import React from 'react'
import { useLoaderData, useSearchParams } from 'react-router-dom'
import { geetCityApi } from '../../api/users'

function Index() {
    const [search]=useSearchParams()
    const loaderData=useLoaderData()
  return (
    <div>
      city
    </div>
  )
}

export default Index

export const loader=async()=>{
    const {data:res}=await geetCityApi()
    console.log(res);
    return{
        list:res.cityList,
        hot:res.hotCities

    }
}
